<meta charset="utf-8">

<div class="box box-primary" id="pmpTasks_assign">
	<form role="form" id="pmpTasks_assign_editForm" >
		<div class="box-body">
				<div class="form-group">
					<label>任务负责人</label>
						<select type="text" name="chargeUserId" class="form-control" id="chargeUserId" v-model="chargeUserId"
								v-kselect="{url:'/pmp/service/pub/pmpProject/loadProjectGroupComboboVo',ajaxKey:'projectId', vmodel:'chargeUserId',firstEmpty:'true'}">
							</select>
				</div>
		</div>
		
		<div class="box-footer">
			<button type="button" class="btn btn-default" v-on:click="cancel">取消</button>
			<button type="button" class="btn btn-info pull-right" v-on:click="doAsign">提交</button>
		</div>
		
	</form>
</div>
<script type="text/javascript">
	new Vue({
			el : '#pmpTasks_assign',
			data : {
				 projectId: project_detail_main.$data.projectId,
				 taskId: zfesLayerEditDg.getLayerParam().id,
				 chargeUserId: zfesLayerEditDg.getLayerParam().chargeUserId,
				bus : new Vue()
			},
			mounted : function() {
				var _this = this;
				_this.chargeUserId: zfesLayerEditDg.getLayerParam().chargeUserId,
			},
			methods : {
				doAsign : function() {
					if ($("#pmpTasks_assign_editForm").valid()) {
						var _this = this;
				        var url = "/pmp/service/pm/pmpTasks/asignPmpTasks";
				       zfesAjax.ajaxTodo(url, {"id":_this.taskId,"chargeUserId": _this.chargeUserId}, function(data) {
				    	   alertSwal.successText(data.message);
							layer.close(layer.index);
				       });
					}
				},
				cancel : function() {
					layer.close(layer.index);
				}
			}
		});
</script>
